﻿namespace OverStore.Configuration
{
    using OverStore.Runtime;
    using OverStore.Runtime.OverStoreContext;

    /// <summary>
    /// Marks the class that can produce new instances of <typeparamref name="TComponent"/> class.
    /// </summary>
    /// <typeparam name="TComponent">The type of the component.</typeparam>
    public interface IComponentConfiguration<TComponent> 
        where TComponent : IRuntimeComponent
    {
        /// <summary>
        /// Creates the new instance of <typeparamref name="TComponent"/> type using set of services provided by <paramref name="context"/> object.
        /// </summary>
        /// <param name="context">The context provides access to services shared between components.</param>
        /// <returns>The new instance of <typeparamref name="TComponent"/> class.</returns>
        TComponent CreateComponent(IOverStoreContext context);
    }
}
